Package org.openquark.cal_Cal_Utilities_DirectedGraph

Source Code of org.openquark.cal_Cal_Utilities_DirectedGraph.Find_Cycle

package org.openquark.cal_Cal_Utilities_DirectedGraph;

import org.openquark.cal.internal.runtime.lecc.RTExecutionContext;
import org.openquark.cal.internal.runtime.lecc.RTResultFunction;
import org.openquark.cal.internal.runtime.lecc.RTSupercombinator;
import org.openquark.cal.internal.runtime.lecc.RTValue;
import org.openquark.cal.runtime.CALExecutorException;
import org.openquark.cal_Cal_Core_Prelude.TYPE_Maybe;

public final class Find_Cycle extends RTSupercombinator {
  /**
   * Singleton instance of this class.
   */
  public static final Find_Cycle $instance = new Find_Cycle();

  /*
   * Data constructor class instances for all referenced data constructors.
   */

  private static final TYPE_Maybe.CAL_Nothing i_Nothing =
    TYPE_Maybe.CAL_Nothing.make();

  private Find_Cycle() {
  }

  public final int getArity() {
    return 2;
  }

  public final java.lang.String getModuleName() {
    return "Cal.Utilities.DirectedGraph";
  }

  public final java.lang.String getUnqualifiedName() {
    return "findCycle";
  }

  public final java.lang.String getQualifiedName() {
    return "Cal.Utilities.DirectedGraph.findCycle";
  }

  /**
   * f
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.findCycle
   */
  public final RTValue f(final RTResultFunction $rootNode, final RTExecutionContext $ec) throws CALExecutorException {
    // Arguments
    RTValue graph = $rootNode.getArgValue();
    RTValue $dictvarCal_Core_Prelude_Eq_38 =
      $rootNode.prevArg().getArgValue();

    // Release the fields in the root node to open them to garbage collection
    $rootNode.clearMembers();
    return
      f2S(
        RTValue.lastRef(
          $dictvarCal_Core_Prelude_Eq_38,
          $dictvarCal_Core_Prelude_Eq_38 = null),
        RTValue.lastRef(graph, graph = null),
        $ec);
  }

  /**
   * f2L
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.findCycle
   */
  public final RTValue f2L(RTValue $dictvarCal_Core_Prelude_Eq_38, RTValue graph, RTExecutionContext $ec) throws CALExecutorException {
    return
      f2S(
        RTValue.lastRef(
          $dictvarCal_Core_Prelude_Eq_38,
          $dictvarCal_Core_Prelude_Eq_38 = null),
        RTValue.lastRef(graph, graph = null),
        $ec);
  }

  /**
   * f2S
   * This method implements the function logic of the CAL function Cal.Utilities.DirectedGraph.findCycle
   */
  public final RTValue f2S(RTValue $dictvarCal_Core_Prelude_Eq_38, RTValue graph, RTExecutionContext $ec) throws CALExecutorException {
    // Top level supercombinator logic
    return
      Find_Cycle_Internal.$instance.f3S(
        $dictvarCal_Core_Prelude_Eq_38,
        graph,
        Find_Cycle.i_Nothing,
        $ec);
  }

}
TOP

Related Classes of org.openquark.cal_Cal_Utilities_DirectedGraph.Find_Cycle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.